package com.econ.powercloud.ems.common.enums;

/**
 * @author hcx
 * @since 2023/8/17 15:12
 **/
public enum OperationTypeEnum implements EnumMethod{
    DELETE(0, "删除"),
    ADD(1, "新增"),
    REFRESH(2,"刷新");

    private Integer code;
    private String desc;

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getDesc() {
        return desc;
    }


    OperationTypeEnum(int code,String desc){
        this.code=code;
        this.desc=desc;
    }

    public static String getCodeFromCode(String code){
        for(OperationTypeEnum type: OperationTypeEnum.values()){
            if(type.getCode().equals(code)){
                return type.getDesc();
            }
        }
        return null;
    }
}
